

def create_colour_bitmap(width,height,colour,alpha)
	img = Wx::Image.new(width, height)
	0.upto(width-1) do | x | 
		0.upto(height-1) do | y |
			pixcol = colour
			img.set_rgb(x, y, pixcol.red, pixcol.green, pixcol.blue)
			img.set_alpha(x, y, alpha)
		end
	end
	return Wx::Bitmap.new(img)
end

if nil == $globalAutoIdCounter then
	$globalAutoIdCounter = ID_HIGHEST + 1
end
def autoGenId()
	$globalAutoIdCounter = $globalAutoIdCounter + 1
	return $globalAutoIdCounter
end

ID_New_Template = autoGenId()
	ID_New_Template_H = autoGenId()
	ID_New_Template_C = autoGenId()
	ID_New_Template_Cpp = autoGenId()
	ID_New_Template_CL = autoGenId()
	ID_New_Template_Text = autoGenId()
	
Toggle_Whitespace = autoGenId()
Toggle_EOL = autoGenId()



$globalFileExtensionType=
{
	"head"=>".h,.hpp",
	"cstd"=>".c",
	"cpp"=>".cpp,.cxx,.cx,.cp",
	"cl"=>".cl",
	"text"=>""
}
def matchFileType(type)
	type.downcase!
	$globalFileExtensionType.each do |key,value|
		if value.include?(type) then
			return key
		end
	end
	return ""
end

def findFileType(path)
	fullPath = Pathname.new(path)
	type = String.new(fullPath.extname.to_s)
	type.downcase!
	typeArray = type.scan(/(\w+)/)
	if typeArray and typeArray[0] and typeArray[0][0] then
		type = typeArray[0][0].to_s
		$globalFileExtensionType.each do |key,value|
			if value.include?(type) then
				return key
			end
		end
	end
	return nil
end
